package com.yin.myproject.thread;

/**
 * @author Eason
 * @create 2018-05-14 14:18
 **/
public class ThreadJoinDemo {
    public volatile static int j = 0;
    public volatile static int i = 0;

    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            for (j = 0; j < 1000000; j++) {
            }
        });
        thread.start();
        thread.join();
        new Thread(() -> {
            for (i = 0; i < 1000000; i++) {
            }
        }).start();
        System.out.println(j);
        System.out.println(i);
    }

}
